#ifndef MYCLASS_H
#define MYCLASS_H

#include <QObject>
#include <QDebug>

class MyClass : public QObject
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "TM3.DeviceManager.test")
    Q_PROPERTY(int Id READ getId WRITE setId)
    Q_PROPERTY(QString text READ getText WRITE setText)
    Q_PROPERTY(PriorityType Priority READ getPriority WRITE setPriority)
    Q_ENUMS(PriorityType)
    Q_ENUMS(ModelType)

public:
    enum PriorityType  {High,Low,VeryHigh,VeryLow};
    enum ModelType  {Small, Medium, Big};

    Q_INVOKABLE explicit MyClass(QObject *parent = nullptr) : QObject(parent) {m_Id = 0;}
    Q_INVOKABLE int printText(QString tag) {qDebug() << tag << m_text; return 1;}

    int getId() {return m_Id; }
    void setId(const int & id) {m_Id = id; }
    QString getText() const { return m_text; }
    void setText(const QString &text) { m_text = text; }
    void setPriority(PriorityType priority) {m_Priority = priority; }
    PriorityType getPriority() const {return m_Priority; }

public slots:
    void service_get(QString st) { qDebug() << "Message get from client: "<< st;}
signals:
    void send_to_client(void);

private:
    QString m_text;
    int      m_Id;
    PriorityType m_Priority;
};

#endif // MYCLASS_H
